import socket

if __name__ == '__main__':
    #创建一个socket连接
    client_socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    client_socket.connect(('127.0.0.1',9090))
    #发送内容
    content='Just say hello'
    content_data=content.encode('GBK')
    client_socket.send(content_data)
    #接受内容
    recv_data=client_socket.recv(1024)
    recv_content=recv_data.decode('GBK')
    print(recv_content)
    #连接关闭
    client_socket.close()